package com.yyx.schoolmusicweb.service;

import com.yyx.schoolmusicweb.mapper.UserMapper;
import com.yyx.schoolmusicweb.model.UserBean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override
    @Transactional
    public boolean addUserInfo(UserBean user) {
    	userMapper.addUserInfo(user);
        return true;
    }

    @Override
    @Transactional
    public int checkedUsername(String username) {
        return userMapper.checkedUsername(username);
    }

    @Override
    @Transactional
    public UserBean loginUserInfo(String username, String password) {
        return userMapper.loginUserInfo(username,password);
    }

    @Override
    @Transactional
    public int deleteUserInfoId(Integer id) {
        return userMapper.deleteUserInfoId(id);
    }

    @Override
    @Transactional
    public UserBean findUserInfo(String username) {
        return userMapper.findUserInfo(username);
    }
}
